<div>
  <!-- 添加 分类 -->
  <el-button type="success" @click='showAddCatDialog' plain>添加分类</el-button>

  <el-table :data="catList" style="width: 100%">
    <!-- 树列
            file-icon="icon icon-file"
      folder-icon="icon icon-folder"
    -->
    <el-table-tree-column
      prop="cat_name"
      label="分类名称"
      width="220"
      tree-key='cat_id'
      parent-key='cat_pid'
      level-key='cat_level'
      :indent-size='30'
    ></el-table-tree-column>
    <!-- <el-table-column prop="cat_name" label="分类名称" width="180"> -->
    </el-table-column>
    <el-table-column prop="cat_deleted" label="是否有效" width="180">
      <template slot-scope="scope">
        <span>{{ scope.row.cat_deleted ? '否' : '是' }}</span>
      </template>
    </el-table-column>
    <el-table-column prop="cat_level" label="层级"> </el-table-column>
    <el-table-column label="操作"> </el-table-column>
  </el-table>

  <!-- 第一个对话框 : 添加分类 -->
  <el-dialog title="添加分类" :visible.sync="dialogAddCatVisible">
      <el-form :model="addCatForm"  label-width="100px">
        <el-form-item label="分类名称">
          <el-input v-model="addCatForm.cat_name" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="父级名称">
          <!-- 级联选择器 -->
          <el-cascader
            v-model='addCatForm.cat_pid_arr'
            :options="options"
            change-on-select
            :props='defaulProps'
          ></el-cascader>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogAddCatVisible = false">取 消</el-button>
        <el-button type="primary" @click="startAddCat">确 定</el-button>
      </div>
    </el-dialog>
</div>
